<extend name="./Apps/Home/View/default/shops/layout.html" />
<block name="content">
<style type="text/css">
#preview{border:1px solid #cccccc; background:#CCC;color:#fff; padding:5px; display:none; position:absolute;}
</style>

    <div class="wst-body"> 
       <div class='wst-page-header'>卖家中心 > 分成记录</div>
       <div class='wst-page-content'>
        <div class='wst-tbar-query'>
       	 用户名：<input type='text' id='userName' value='{$userName}' style="width:80px;"/>
		订单号：<input type='text' id='orderNo' value='{$orderNo}' style="width:80px;"/>
		记录时间：<input type='text' id='startDate' class='laydate-icon' name='startDate' value='{$startDate}' style='width:100px;line-height:16px;height:auto;' placeholder='开始日期' onclick='laydate({format: "YYYY-MM-DD"})'/>
             <input type='text' id='endDate' class='laydate-icon' name='endDate' value='{$endDate}' style='' placeholder='结束日期' onclick='laydate({format: "YYYY-MM-DD"})'/>
		佣金状态：
		<select id="settlementId">
			<option value="-999" <if condition="$settlementId eq 0">selected</if>>所有状态</option>
			<option value="0" <if condition="$settlementId eq 0">selected</if>>未结算</option>
			<option value="1" <if condition="$settlementId eq 1">selected</if>>已结算</option>
		</select>
		<button class='wst-btn-query' onclick='javascript:queryShopDistributMoneys()'>查询</button>
        </div>
        <table class='wst-list'>
           <thead>
           	<tr>
               <th width="100">订单编号</th>
               <th width="120">获佣用户</th>
               <th>佣金描述</th>
               <th width="100">商品金额</th>
               <th width="100">佣金</th>
               <th width="150">记录时间</th>
               <th width="80">佣金状态</th>
             </tr>
           </thead>
           <tbody>
            <volist name="Page['root']" id="vo" key='i'>
             <tr >
               <td ><a href="javascript:;" style="color:blue;font-weight:bold;" onclick="showOrder('20')">{$vo["orderNo"]}</a></td>
               <td >{$vo["userName"]!=""?$vo["userName"]:$vo["loginName"]}</td>
               <td >{$vo["moneyRemark"]}</td>
               <td >{$vo["money"]}</td>
               <td >{$vo["distributMoney"]}</td>
               <td >{$vo["createTime"]}</td>
               <td >{$vo["settlementId"]==1?"<span style='color:green;'>已结算</span>":"<span style='color:red;'>未结算</span>"}</td>
             </tr>
             </volist>
             <tfoot>
             <tr>
                <td colspan='7'>
                <div class="wst-page" style="float:right;padding-bottom:10px;">
					<div id="wst-page-items"></div>
				</div>
                <script>
			    <if condition="$Page['totalPage'] gt 1">
			    $(document).ready(function(){
					laypage({
					    cont: 'wst-page-items',
					    pages: {$Page['totalPage']}, //总页数
					    skip: true, //是否开启跳页
					    skin: '#e23e3d',
					    groups: 3, //连续显示分页数
					    curr: function(){ //通过url获取当前页，也可以同上（pages）方式获取
					        var page = location.search.match(/p=(\d+)/);
					        return page ? page[1] : 1;
					    }(), 
					    jump: function(e, first){ //触发分页后的回调
					        if(!first){ //一定要加此判断，否则初始时会无限刷新
					        	var nuewurl = WST.splitURL("p");
					        	var ulist = nuewurl.split("?");
					        	if(ulist.length>1){
					        		location.href = nuewurl+'&p='+e.curr;
					        	}else{
					        		location.href = '?p='+e.curr;
					        	}
					            
					        }
					    }
					});
			    });
				</if>
				</script>
                </td>
             </tr>
             </tfoot>
           </tbody>
        </table>
        </div>
    </div>
    <script src="__ROOT__/Apps/Home/View/{$WST_STYLE}/js/distributs.js"></script>
</block> 